export const getStorage = (key) => {
  const res = window.localStorage.getItem(key);
  try {
    return JSON.parse(res);
  } catch (e) {
    return res;
  }
};

export const setStorage = (key, value) => {
  window.localStorage.setItem(
    key,
    typeof value === "string" ? value : JSON.stringify(value)
  );
};

export const removeStorage = (key) => {
  return window.localStorage.removeItem(key);
};
